<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">

<ui:composition template="/template.xhtml">
	
	<ui:define name="content">
	    <h:form>
	    <f:loadBundle basename="resources.crearPost" var="msg"/>
	    	
	    	<h5 class="title" align="right">
	    	<h:commandButton value="#{msg.function}" action="/funcionesUsuario.xhtml"/>
	    	<h:commandButton value="cerrar sesion" action="#{usuarioBackBeenSesion.cerrarSesion}"/>
          	</h5>
          	
           <center>
           <rich:panel style="color:blue">	
			<f:facet name="header" >
		      <h:outputText value="#{msg.post}" /> 
		    </f:facet>
               <h:panelGrid columns="3">
               
					
					<h:outputText value="#{msg.contenido}:"/>  
					<h:inputTextarea label="Contenido" id="contenido" required="true" value="#{usuarioBackBeenSesion.contenido}" />
					<rich:message for="contenido">
						<f:facet name="passedMarker">
							<h:graphicImage value="/resources/passed.gif" />   
						</f:facet>
						 <f:facet name="errorMarker">
                            <h:graphicImage value="/resources/error.gif" />  
                        </f:facet>
					</rich:message>
					
					<h:outputText  value="#{msg.tag}:"/> <h:inputText id="tag" required="true"  value="#{usuarioBackBeenSesion.tag}" />
					<rich:message for="tag">
						<f:facet name="passedMarker">
							<h:graphicImage value="/resources/passed.gif" />   
						</f:facet>
						 <f:facet name="errorMarker">
                            <h:graphicImage value="/resources/error.gif" />  
                        </f:facet>
					</rich:message>
					
					<h:outputText value="#{msg.titulo}:"/>     <h:inputText id="titulo" required="true" value="#{usuarioBackBeenSesion.titulo}" />
					<rich:message for="titulo">
						<f:facet name="passedMarker">
							<h:graphicImage value="/resources/passed.gif" />   
						</f:facet>
						 <f:facet name="errorMarker">
                            <h:graphicImage value="/resources/error.gif" />  
                        </f:facet>
					</rich:message>
					
					<h:outputText  value="#{msg.fuente}"/>     <h:inputText id="fuente" required="true" value="#{usuarioBackBeenSesion.fuente}" />
					<rich:message for="fuente">
						<f:facet name="passedMarker">
							<h:graphicImage value="/resources/passed.gif" />   
						</f:facet>
						 <f:facet name="errorMarker">
                            <h:graphicImage value="/resources/error.gif" />  
                        </f:facet>
                    </rich:message>
					
					
					<h:outputText value="#{msg.categoria}:"/>
				    <h:selectOneMenu value="#{usuarioBackBeenSesion.categoria}" converter="selectItemObjectConverter">
					   <f:selectItems value="#{usuarioBackBeenSesion.listaCategorias}" var="categoria"	itemLabel="#{categoria.descripcion}" />
				    </h:selectOneMenu>

              </h:panelGrid>
              
              		<h:commandButton value="#{msg.ok}" action="#{usuarioBackBeenSesion.crearPost}"/>
              		
         </rich:panel>
       </center>
	    </h:form>
	</ui:define>
	
</ui:composition>
</html>